#include "tip.h"
#include "ui_tip.h"
#include "game2.h"
#include <QPainter>
#include <QFont>
#include <QPixmap>
#include <QTimer>

tip::tip(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::tip)
{
    ui->setupUi(this);
    this->setAttribute(Qt::WA_DeleteOnClose);
}

tip::~tip()
{
    delete ui;
}

void tip::paintEvent(QPaintEvent *)
{
    QPainter painter(this);
    int x1=ui->p2frame->pos().x();
    int y1=ui->p2frame->pos().y();
    qh[0].load(":/resourse/p2.png") ;
    painter.drawPixmap(x1,y1,ui->p2frame->width(),ui->p2frame->height(),qh[0]);
}

void tip::on_backpushButton_clicked()
{
    this->close();
    Game2 *g=new Game2();
    g->show();
}
